<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 将数组中值为 0 的项去掉，将不为 0 的值存入一个新的数组，生成新的数组。
        let arr = [100,70,50,85,60,0,95,78,82,88];
        let brr = [];
        for (let i = 0; i < arr.length; i++) {
            if (arr[i] !== 0) {
                brr.push(arr[i]);
            }
        }
        console.log(brr);
    </script>
</head>
<body>
    
</body>
</html>